#ifndef CBACKGROUNDWIDGET_H
#define CBACKGROUNDWIDGET_H

#include <QWidget>

#include "paintlistwidget.h"
#include "colorwidget.h"
#include "Selectbgcolorwidget.h"

namespace Ui {
class CbackgroundWidget;
}

class CbackgroundWidget : public QWidget
{
    Q_OBJECT

public:
    explicit CbackgroundWidget(QWidget *parent = nullptr);
    QString colorStr;

    ~CbackgroundWidget();

public slots:
    void saveImg();
    void stopShare();
    void entershareBtn();
    void showPaintWindow();

    void onBtnPenClicked();
    void onBtnNitePenClicked();
    void onBtnEraserClicked();
    void onBtnRevokeClicked();
    void onBtnBgClicked();
    void onBtnClearClicked();
    void onBtnExitClicked();
    void onBtnSelectPenClicked();
    void onBtnSelectNitePenClicked();

    void changePenColor();
    void changePenLineSize();

    void c_changeDrawBg(QString);

protected:
    void paintEvent(QPaintEvent *);

    void AllPropertyWidgetHide();
    bool isLucency = true;

signals:
    void changeBgColor();
    void stopDraw();

private:
    Ui::CbackgroundWidget *ui;
    PaintListWidget *paintListWidget;
    ColorWidget *colorWidget;
    SelectBgColorWidget *selectBgColorWidget;
    void initUI();
};

#endif // CBACKGROUNDWIDGET_H
